﻿USE [C:\USERS\MARCO\DOCUMENTS\TFS\TRAINGROUP\TRAINGROUP\TRAINGROUP\BIN\DATA\APPLICATIONDATABASE.MDF]
GO

-- disable all constraints
EXEC sp_msforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"

-- delete data in all tables
DELETE FROM tbServerJobParameterSet
DELETE FROM tbServerJobSet
DELETE FROM tbStakeholderSet
DELETE FROM tbTrainsessionSet
DELETE FROM tlCustomPropertyChoicesSet
DELETE FROM tlCustomPropertySet
DELETE FROM tlIntervalSet
DELETE FROM tlIntervalValueSet
DELETE FROM tlJobStatusSet
DELETE FROM tlTraingroupSet
DELETE FROM trIntervalValueTraingroupSet
DELETE FROM trStakeholderCustomPropertySet
DELETE FROM trStakeholderTrainsessionSet
DELETE FROM trTraingroupStakeholderSet

-- enable all constraints
exec sp_msforeachtable "ALTER TABLE ? WITH CHECK CHECK CONSTRAINT all"